<%@ page import="com.informet.ipd.modelo.dao.MActividadDao" %>
<%@ page import="com.informet.ipd.modelo.dao.DemandaDao"%>
<%@ page import="com.informet.ipd.modelo.dao.APermanenteDao"%>
<%@ page import="com.informet.ipd.modelo.vo.DemandaVO" %>
<%@ page import="com.informet.ipd.modelo.vo.APermanenteVO" %>
<%@ page import="com.informet.ipd.struts.form.MActividadForm" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.swing.JOptionPane"%>
<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/tags/c" prefix="c"%>

<%
            StringBuffer cadenaSalida = new StringBuffer();
            List lista = null;//lista
            DemandaDao supportFacade = new DemandaDao();
            APermanenteDao supportFacade2 = new APermanenteDao();
            MActividadForm form= new MActividadForm();//form
            DemandaVO vo = null;
            APermanenteVO vo2=null;
            try {
               int codObjEsp = Integer.parseInt(request.getParameter("codObjEsp"));
               int id = Integer.parseInt(request.getParameter("id"));
               int id2 = Integer.parseInt(request.getParameter("id2"));
               String descactp = request.getParameter("descactp");
               String umap = request.getParameter("umap");
               int cantap = Integer.parseInt(request.getParameter("cantap"));
               String tipap = request.getParameter("tipap");
               int tipo = Integer.parseInt(request.getParameter("tipo"));
               String dep=session.getAttribute("dependencia").toString();
               int depen=Integer.parseInt(dep);
               vo=new DemandaVO(id,id2,depen,codObjEsp,descactp,umap,cantap,tipap);
               supportFacade.spManm(tipo, vo);
               
               lista = supportFacade2.getComboMod(codObjEsp,depen);
               cadenaSalida.append("<select  name='codActPer' id='codActPer' onchange='NuevaAPermanente()'  style='width: 360px'>");
                cadenaSalida.append(" <option value='-1'>[--Seleccionar Act Permanente--]</option>");
                Iterator it = lista.iterator();
                while (it.hasNext()) {
                    vo2 = (APermanenteVO) it.next();

                   
                    cadenaSalida.append("<option value='"+vo2.getNUM_CODACTPER_PK()+"'>"+vo2.getTX_DESCACTPER()+"</option>");

                   
                }

                cadenaSalida.append(" <option value='0'>[--Nueva Actividad Permanente--]</option>");
                
                 cadenaSalida.append("</select>");



            } catch (Exception e) {
                cadenaSalida.append(e.toString());
            }
            out.println(cadenaSalida);
%>

